package com.yu.dao;

import com.yu.pojo.Dept;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface DeptMapper {

    @Select("select * from dept")
    List<Dept> selectAll();

    @Delete("delete from dept where id = #{id}")
    int deleteById(@Param("id") Integer id);

    @Insert("insert into dept values (null, #{name}, #{createTime}, #{updateTime})")
    int insertDept(Dept dept);

    @Select("select * from dept where id = #{id}")
    Dept findById(@Param("id") Integer id);

    int updateDept(Dept dept);
}
